<template>
	<view class="home">
		<view class="title">
			<image @click="back()" src="../../static/fanhui.png"
				style="float: left; width: 20px;vertical-align: middle;height: 20px;" mode=""></image> 我的归还

		</view>
		<view class="zllb">
			<view class="listzl" v-for="item in list" @click="zlhd(item)">
				<view class="listimg">
					<image :src="item.carimg" mode=""></image>
				</view>
				<view class="listcontent">
					<view class="sx">
						租赁时间:{{item.zlsj}}
					</view>
					<view class="sx">
						归还时间:{{item.ghsj}}
					</view>
					<view class="sx">
						<el-tag v-if="item.status == 0">待审核</el-tag>
						<el-tag v-if="item.status == 1">已通过</el-tag>
						<el-tag v-if="item.status == 2">驳回</el-tag>

					</view>
				</view>

			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: "",
				list: [],
			}
		},
		mounted() {
			this.getid()
		},
		methods: {
			back(){
				uni.switchTab({
					url:"/pages/my/my"
				})
			},
			zlhd(item){
				let data=JSON.stringify(item)
				uni.navigateTo({
					url:`/pages/ghxq/ghxq?data=${data}`,
					
				})
			},
			getid() {
				let id = JSON.parse(window.localStorage.getItem("userinfo")).id;
				console.log(id)
				uni.request({
					url: `index/grgh?uid=${id}`,
					method: "GET",

					success: (res) => {
						console.log(res)
						this.list = res.data.data
					}
				})
			}
		}
	}
</script>

<style scoped>
	.sx {
		margin-bottom: 15px;
	}

	.listimg image {
		width: 100%;
		height: 100%;
	}

	.listimg {
		width: 100px;
		height: 100px;
		border-radius: 10px;
		float: left;
	}

	.listcontent {
		width: calc(100% - 100px);
		padding-left: 10px;
		box-sizing: border-box;
		float: right;
	}

	.listzl {

		width: 100%;
		height: auto;
		padding: 10px;
		box-sizing: border-box;
		background: #fff;
		overflow: hidden;
		margin-bottom: 10px;
		border-radius: 5px;
	}

	.zllb {
		width: 100%;
		height: calc(100% - 39px);
		padding: 10px;
		box-sizing: border-box;
	}

	.home {
		width: 100%;
		height: 100%;

		background: #f3f6fe;

	}

	.title {
		width: 100%;
		height: auto;
		padding: 10px;
		box-sizing: border-box;
		background: purple;
		color: #fff;
		text-align: center;
		font-size: 14px;
	}
</style>